using UnityEngine;
// [Assembly-CSharp.dll].DestroyPath
public class DestroyPath : MonoBehaviour
{
    // Fields
    public bool isPermanent;
    private System.Collections.Generic.List<UnityEngine.Vector2> newVerticies;
    public float destroyCounter;
    private bool canDestroy;
    private UnityEngine.Vector2 centerOfMass;
    private DrawingManager managerScript;
    private bool dynamicMass;
    private float massScale;
    
    // Methods
    private void Start()
    {
        this.managerScript = UnityEngine.GameObject.Find(name:  -1610608093).GetComponent<System.Object>();
        this.newVerticies = val_2.newVerticies;
        this.destroyCounter = val_2.lifeTime;
        this.isPermanent = val_2.isPermanent;
    }
    private void Update()
    {
        var val_7;
        float val_8;
        var val_13;
        if((UnityEngine.Input.GetMouseButtonUp(button:  0)) == false)
        {
            goto label_3;
        }
        
        val_13 = this.name;
        var val_12 = mem[536885469];
        val_12 = val_12 - 1;
        if((val_13.Equals(value:  -1610608097(-1610608097) + val_12.ToString())) == false)
        {
            goto label_3;
        }
        
        val_13 = 27380232;
        System.Collections.Generic.List<T>.System.Collections.Generic.List.Enumerator<Unknown> val_6 = this.newVerticies.GetEnumerator();
        label_6:
        if(val_7.MoveNext() == false)
        {
            goto label_5;
        }
        
        double val_13 = val_8;
        val_13 = val_13 + this.centerOfMass;
        this.centerOfMass = val_13;
        goto label_6;
        label_5:
        val_7.Dispose();
        this.canDestroy = true;
        float val_14 = (float)val_7;
        val_14 = this.centerOfMass / val_14;
        this.centerOfMass = val_14;
        label_3:
        if(this.destroyCounter <= 0f)
        {
                return;
        }
        
        if(this.isPermanent != false)
        {
                return;
        }
        
        if(this.canDestroy == false)
        {
                return;
        }
        
        float val_10 = UnityEngine.Time.deltaTime;
        val_10 = this.destroyCounter - val_10;
        this.destroyCounter = val_10;
        if(val_10 > 0f)
        {
                return;
        }
        
        UnityEngine.Object.Destroy(obj:  this.gameObject);
    }
    public DestroyPath()
    {
        System.Collections.Generic.List<UnityEngine.Vector2> val_1 = 536903815;
        val_1 = new System.Collections.Generic.List<UnityEngine.Vector2>();
        this.newVerticies = val_1;
        this.centerOfMass = mem[536895699];
    }

}
